/*
* Conditions Of Use
*
* This software was developed by employees of the Sigmatrix(Beijing) Corporation.
* This software is provided by sigmatrix as a service and is expressly
* provided "AS IS."  Sigmatrix MAKES NO WARRANTY OF ANY KIND, EXPRESS, IMPLIED
* OR STATUTORY, INCLUDING, WITHOUT LIMITATION, THE IMPLIED WARRANTY OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, NON-INFRINGEMENT
* AND DATA ACCURACY.  Sigmatrix does not warrant or make any representations
* regarding the use of the software or the results thereof, including but
* not limited to the correctness, accuracy, reliability or usefulness of
* the software.
*
* Permission to use this software is contingent upon your acceptance
* of the terms of this agreement.
*
*/
package com.sigmatrix.h5.service;

import java.util.List;

import com.microsoft.windowsazure.exception.ServiceException;
import com.sigmatrix.h5.dto.DisTerminalShopData;
import com.sigmatrix.h5.entity.DisTerminalShop;
import com.sigmatrix.h5.utils.baidu.po.LatLngLocation;
import com.sigmatrix.h5.web.args.RegistTerminalShopParam;
import com.sigmatrix.h5.web.args.TerminalShopInfoResponse;
import com.sigmatrix.sc.jdbc.common.service.Service;

/**
 *@ClassName: DisTerminalShopService
 *@Description: 
 *@author MH
 *@date 2017年8月14日 上午10:41:35
 */
public interface DisTerminalShopService extends Service<DisTerminalShop,Integer>{
	/**
	 * 通过openId跟经销商查询
	 *@Title: findByOpenIdAndDealerId
	 *@Description: 
	 *@return DisTerminalShop
	 *@author MH
	 *@date 2017年9月7日 下午2:28:03
	 *@param openId
	 *@param dealerId
	 *@return
	 */
	List<DisTerminalShop> findByOpenId(String openId);
	
	DisTerminalShop findByName(String name);
	
	DisTerminalShop findByCode(String code);
	/**
	 * 
	 *@Title: gpsLoaction
	 *@Description: GPS定位设置地点
	 *@return void
	 *@author MH
	 *@date 2017年12月15日 下午1:04:55
	 *@param shop
	 *@throws ServiceException
	 */
	void gpsLoaction(DisTerminalShop shop);
	/**
	 * 
	 *@Title: gpsLoaction
	 *@Description: 设置地点
	 *@return void
	 *@author MH
	 *@date 2017年12月15日 下午1:05:23
	 *@param shop
	 *@param location
	 *@throws ServiceException
	 */
	void gpsLoaction(DisTerminalShop shop, LatLngLocation location);
	/**
	 * 
	 *@Title: genShopCode
	 *@Description: 生成编码
	 *@return String
	 *@author MH
	 *@date 2017年12月15日 下午1:05:32
	 *@return
	 */
	String genShopCode();
	
	/**
	 * 
	 *@Title: directSave
	 *@Description: 
	 *@return DisTerminalShop
	 *@author MH
	 *@date 2017年12月20日 上午11:13:48
	 *@param vo
	 *@return
	 */
	DisTerminalShop directSave(RegistTerminalShopParam vo);
	/**
	 * 
	 *@Title: getLastApplyInfo
	 *@Description: 查询上次注册信息
	 *@return DisTerminalShop
	 *@author MH
	 *@date 2018年1月5日 下午3:25:22
	 *@param openId
	 *@return
	 */
	DisTerminalShop getLastApplyInfo(String openId);
	
	TerminalShopInfoResponse getLastApplyInfo2(String openId);

	DisTerminalShop findByOpenIdAndDealerId(String openId, Integer dealerId);
	/**
	 * 注册终端门店，需要审核，并且需要生成crm账号
	 * 
	 * @param vo
	 * @return
	 */
	DisTerminalShop registShop(RegistTerminalShopParam vo);
	
	/**
	 * 分销app合并分支开始-------------------------------------
	 */
	
	List<DisTerminalShopData> findByDealerId(Integer dealerId,String enterpriseCode);
	
	DisTerminalShopData findById(Integer id,String enterpriseCode);
	
	/**
	 * 分销app合并分支结束-------------------------------------
	 */
}
